package cloud.oss.upload.lsp;

import java.util.ArrayList;
import java.util.List;

/**
 * @author guan.xin
 * @title Sub
 * @description
 * @create 2022-05-18 18:49
 * @since JDK8
 */
public class Sub extends Main {

    public Sub() {
        super(getList());
    }

    public void extend() {
        Ops ops = new Ops();
        ops.setUserId(2);
        ops.setUserName("name");

        List<Ops> originalList = new ArrayList<>();
        list.forEach(e -> {
            originalList.add(e);
        });
        list.clear();
        list.add(ops);
        if (originalList.size() > 0) {
            list.addAll(originalList);
        }
    }

    public List<Ops> get() {
        return list;
    }

    public static List<Ops> getList() {
        Ops ops = new Ops();
        ops.setUserId(1);
        ops.setUserName("user");
        List<Ops> list = new ArrayList<>();
        list.add(ops);
        return list;
    }
}
